/*
Adept MobileRobots Robotics Interface for Applications (ARIA)
Copyright (C) 2004-2005 ActivMedia Robotics LLC
Copyright (C) 2006-2010 MobileRobots Inc.
Copyright (C) 2011-2014 Adept Technology

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

If you wish to redistribute ARIA under different terms, contact 
Adept MobileRobots for information about a commercial version of ARIA at 
robots@mobilerobots.com or 
Adept MobileRobots, 10 Columbia Drive, Amherst, NH 03031; +1-603-881-7960
*/
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.40
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.mobilerobots.Aria;

public class ArRangeBuffer {
  /* (begin code from javabody typemap) */

  private long swigCPtr;
  protected boolean swigCMemOwn;

  /* for internal use by swig only */
  public ArRangeBuffer(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  /* for internal use by swig only */
  public static long getCPtr(ArRangeBuffer obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  /* (end code from javabody typemap) */

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        AriaJavaJNI.delete_ArRangeBuffer(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public ArRangeBuffer(int size) {
    this(AriaJavaJNI.new_ArRangeBuffer(size), true);
  }

  public long getSize() {
    return AriaJavaJNI.ArRangeBuffer_getSize(swigCPtr, this);
  }

  public void setSize(long size) {
    AriaJavaJNI.ArRangeBuffer_setSize(swigCPtr, this, size);
  }

  public ArPose getPoseTaken() {
    return new ArPose(AriaJavaJNI.ArRangeBuffer_getPoseTaken(swigCPtr, this), true);
  }

  public void setPoseTaken(ArPose p) {
    AriaJavaJNI.ArRangeBuffer_setPoseTaken(swigCPtr, this, ArPose.getCPtr(p), p);
  }

  public ArPose getEncoderPoseTaken() {
    return new ArPose(AriaJavaJNI.ArRangeBuffer_getEncoderPoseTaken(swigCPtr, this), true);
  }

  public void setEncoderPoseTaken(ArPose p) {
    AriaJavaJNI.ArRangeBuffer_setEncoderPoseTaken(swigCPtr, this, ArPose.getCPtr(p), p);
  }

  public void addReading(double x, double y) {
    AriaJavaJNI.ArRangeBuffer_addReading(swigCPtr, this, x, y);
  }

  public void addReadingConditional(double x, double y, double closeDistSquared, SWIGTYPE_p_bool wasAdded) {
    AriaJavaJNI.ArRangeBuffer_addReadingConditional__SWIG_0(swigCPtr, this, x, y, closeDistSquared, SWIGTYPE_p_bool.getCPtr(wasAdded));
  }

  public void addReadingConditional(double x, double y, double closeDistSquared) {
    AriaJavaJNI.ArRangeBuffer_addReadingConditional__SWIG_1(swigCPtr, this, x, y, closeDistSquared);
  }

  public void beginInvalidationSweep() {
    AriaJavaJNI.ArRangeBuffer_beginInvalidationSweep(swigCPtr, this);
  }

  public void invalidateReading(SWIGTYPE_p_std__listT_ArPoseWithTime_p_t__iterator readingIt) {
    AriaJavaJNI.ArRangeBuffer_invalidateReading(swigCPtr, this, SWIGTYPE_p_std__listT_ArPoseWithTime_p_t__iterator.getCPtr(readingIt));
  }

  public void endInvalidationSweep() {
    AriaJavaJNI.ArRangeBuffer_endInvalidationSweep(swigCPtr, this);
  }

  public ArPoseWithTimePtrList getBuffer() {
    long cPtr = AriaJavaJNI.ArRangeBuffer_getBuffer(swigCPtr, this);
    return (cPtr == 0) ? null : new ArPoseWithTimePtrList(cPtr, false);
  }

  public double getClosestPolar(double startAngle, double endAngle, ArPose position, long maxRange, SWIGTYPE_p_double angle) {
    return AriaJavaJNI.ArRangeBuffer_getClosestPolar__SWIG_0(swigCPtr, this, startAngle, endAngle, ArPose.getCPtr(position), position, maxRange, SWIGTYPE_p_double.getCPtr(angle));
  }

  public double getClosestPolar(double startAngle, double endAngle, ArPose position, long maxRange) {
    return AriaJavaJNI.ArRangeBuffer_getClosestPolar__SWIG_1(swigCPtr, this, startAngle, endAngle, ArPose.getCPtr(position), position, maxRange);
  }

  public double getClosestBox(double x1, double y1, double x2, double y2, ArPose position, long maxRange, ArPose readingPos, ArPose targetPose) {
    return AriaJavaJNI.ArRangeBuffer_getClosestBox__SWIG_0(swigCPtr, this, x1, y1, x2, y2, ArPose.getCPtr(position), position, maxRange, ArPose.getCPtr(readingPos), readingPos, ArPose.getCPtr(targetPose), targetPose);
  }

  public double getClosestBox(double x1, double y1, double x2, double y2, ArPose position, long maxRange, ArPose readingPos) {
    return AriaJavaJNI.ArRangeBuffer_getClosestBox__SWIG_1(swigCPtr, this, x1, y1, x2, y2, ArPose.getCPtr(position), position, maxRange, ArPose.getCPtr(readingPos), readingPos);
  }

  public double getClosestBox(double x1, double y1, double x2, double y2, ArPose position, long maxRange) {
    return AriaJavaJNI.ArRangeBuffer_getClosestBox__SWIG_2(swigCPtr, this, x1, y1, x2, y2, ArPose.getCPtr(position), position, maxRange);
  }

  public void applyTransform(ArTransform trans) {
    AriaJavaJNI.ArRangeBuffer_applyTransform(swigCPtr, this, ArTransform.getCPtr(trans), trans);
  }

  public void clear() {
    AriaJavaJNI.ArRangeBuffer_clear(swigCPtr, this);
  }

  public void clearOlderThan(int milliSeconds) {
    AriaJavaJNI.ArRangeBuffer_clearOlderThan(swigCPtr, this, milliSeconds);
  }

  public void clearOlderThanSeconds(int seconds) {
    AriaJavaJNI.ArRangeBuffer_clearOlderThanSeconds(swigCPtr, this, seconds);
  }

  public void reset() {
    AriaJavaJNI.ArRangeBuffer_reset(swigCPtr, this);
  }

  public void beginRedoBuffer() {
    AriaJavaJNI.ArRangeBuffer_beginRedoBuffer(swigCPtr, this);
  }

  public void redoReading(double x, double y) {
    AriaJavaJNI.ArRangeBuffer_redoReading(swigCPtr, this, x, y);
  }

  public void endRedoBuffer() {
    AriaJavaJNI.ArRangeBuffer_endRedoBuffer(swigCPtr, this);
  }

  public ArPoseWithTimeVector getBufferAsVector() {
    long cPtr = AriaJavaJNI.ArRangeBuffer_getBufferAsVector(swigCPtr, this);
    return (cPtr == 0) ? null : new ArPoseWithTimeVector(cPtr, false);
  }

  public static double getClosestPolarInList(double startAngle, double endAngle, ArPose position, long maxRange, SWIGTYPE_p_double angle, ArPoseWithTimePtrList buffer) {
    return AriaJavaJNI.ArRangeBuffer_getClosestPolarInList(startAngle, endAngle, ArPose.getCPtr(position), position, maxRange, SWIGTYPE_p_double.getCPtr(angle), ArPoseWithTimePtrList.getCPtr(buffer), buffer);
  }

  public static double getClosestBoxInList(double x1, double y1, double x2, double y2, ArPose position, long maxRange, ArPose readingPos, ArPose targetPose, ArPoseWithTimePtrList buffer) {
    return AriaJavaJNI.ArRangeBuffer_getClosestBoxInList(x1, y1, x2, y2, ArPose.getCPtr(position), position, maxRange, ArPose.getCPtr(readingPos), readingPos, ArPose.getCPtr(targetPose), targetPose, ArPoseWithTimePtrList.getCPtr(buffer), buffer);
  }

}
